/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ComponenteEntidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Marilyn
 */
@Entity
@Table(name = "detalleproveedor")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Detalleproveedor.findAll", query = "SELECT d FROM Detalleproveedor d"),
    @NamedQuery(name = "Detalleproveedor.findByIdDetalleProveedor", query = "SELECT d FROM Detalleproveedor d WHERE d.idDetalleProveedor = :idDetalleProveedor"),
    @NamedQuery(name = "Detalleproveedor.findByDprovSucursal", query = "SELECT d FROM Detalleproveedor d WHERE d.dprovSucursal = :dprovSucursal"),
    @NamedQuery(name = "Detalleproveedor.findByContacto", query = "SELECT d FROM Detalleproveedor d WHERE d.contacto = :contacto"),
    @NamedQuery(name = "Detalleproveedor.findByDprovDireccion", query = "SELECT d FROM Detalleproveedor d WHERE d.dprovDireccion = :dprovDireccion"),
    @NamedQuery(name = "Detalleproveedor.findByDprovTelefono", query = "SELECT d FROM Detalleproveedor d WHERE d.dprovTelefono = :dprovTelefono"),
    @NamedQuery(name = "Detalleproveedor.findByDprovCelular", query = "SELECT d FROM Detalleproveedor d WHERE d.dprovCelular = :dprovCelular"),
    @NamedQuery(name = "Detalleproveedor.findByDprovEmail", query = "SELECT d FROM Detalleproveedor d WHERE d.dprovEmail = :dprovEmail")})
public class Detalleproveedor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idDetalleProveedor")
    private Integer idDetalleProveedor;
    @Size(max = 45)
    @Column(name = "dprov_Sucursal")
    private String dprovSucursal;
    @Size(max = 200)
    @Column(name = "Contacto")
    private String contacto;
    @Size(max = 250)
    @Column(name = "dprov_Direccion")
    private String dprovDireccion;
    @Size(max = 15)
    @Column(name = "dprov_Telefono")
    private String dprovTelefono;
    @Size(max = 15)
    @Column(name = "dprov_Celular")
    private String dprovCelular;
    @Size(max = 60)
    @Column(name = "dprov_email")
    private String dprovEmail;
    @JoinColumn(name = "idProveedor", referencedColumnName = "idProveedor")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Proveedor proveedor;

    public Detalleproveedor() {
    }

    public Detalleproveedor(Integer idDetalleProveedor) {
        this.idDetalleProveedor = idDetalleProveedor;
    }

    public Integer getIdDetalleProveedor() {
        return idDetalleProveedor;
    }

    public void setIdDetalleProveedor(Integer idDetalleProveedor) {
        this.idDetalleProveedor = idDetalleProveedor;
    }

    public String getDprovSucursal() {
        return dprovSucursal;
    }

    public void setDprovSucursal(String dprovSucursal) {
        this.dprovSucursal = dprovSucursal;
    }

    public String getContacto() {
        return contacto;
    }

    public void setContacto(String contacto) {
        this.contacto = contacto;
    }

    public String getDprovDireccion() {
        return dprovDireccion;
    }

    public void setDprovDireccion(String dprovDireccion) {
        this.dprovDireccion = dprovDireccion;
    }

    public String getDprovTelefono() {
        return dprovTelefono;
    }

    public void setDprovTelefono(String dprovTelefono) {
        this.dprovTelefono = dprovTelefono;
    }

    public String getDprovCelular() {
        return dprovCelular;
    }

    public void setDprovCelular(String dprovCelular) {
        this.dprovCelular = dprovCelular;
    }

    public String getDprovEmail() {
        return dprovEmail;
    }

    public void setDprovEmail(String dprovEmail) {
        this.dprovEmail = dprovEmail;
    }

    public Proveedor getProveedor() {
        return proveedor;
    }

    public void setProveedor(Proveedor proveedor) {
        this.proveedor = proveedor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetalleProveedor != null ? idDetalleProveedor.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Detalleproveedor)) {
            return false;
        }
        Detalleproveedor other = (Detalleproveedor) object;
        if ((this.idDetalleProveedor == null && other.idDetalleProveedor != null) || (this.idDetalleProveedor != null && !this.idDetalleProveedor.equals(other.idDetalleProveedor))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ComponenteEntidad.Detalleproveedor[ idDetalleProveedor=" + idDetalleProveedor + " ]";
    }
    
}
